<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>黔南民族师范学院综合教育学分认定系统</title>

	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/icon.css" />
	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/default/easyui.css"/>

	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
	<style type="text/css" th:inline="none">
		form div{
			margin:20px auto;
			width:250px;
			text-align:center
		}

	</style>
    <script type="text/javascript"  th:inline="none">
    	$(function(){
    		$("input[name=upload]").validatebox({
    			required:true,
    			missingMessage:'请输入.xlsx类型文件'
    		});

    		$("#ff").form("disableValidation");
			$("#btn").click(function(){
				$("#ff").form("enableValidation");
				//通过校验
				if($("#ff").form("validate")){

					$("#ff").form('submit',{
						entryType:'multipart/form-data',
						url:'/upload',
						error : function(event, request, settings) {
							$.messager.alert("提示消息", "请求失败!");
						},
						success : function(data) {
							parent.$("#win").window("close");
							parent.$("iframe[title='学生信息管理']").get(0).contentWindow.$("#dg").datagrid("reload");
							$.messager.show({
								title:'温馨提示',
								msg:data+"!",
								timeout:5000,
								showType:'slide'
							});
						}
					});
				}
			});
		});
    </script>
  </head>
  
  <body>
  	<form id="ff" method="post" enctype="multipart/form-data" action="/upload">
	    <div>
	        <label>导入Excel文件:</label>
	        <input type="file" name="upload" />
	    </div>
<!--	    <div>
	    	<button type="submit" class="easyui-linkbutton">开始导入</button>

	    </div>-->
		<div>
			<a style="text-align:center;" id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">开始导入</a>
		</div>
	</form>
  </body>
</html>
